import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-order-join-modal-content',
  templateUrl: './order-join-modal-content.component.html',
  styleUrls: ['./order-join-modal-content.component.css']
})
export class OrderJoinModalContentComponent implements OnInit {

  constructor() { }

  ngOnInit() {
    this._data.push(this.all)
  }
  _data = [

  ]
  all = {
    type: '0',
    value: '0',
    name: 'all',
    label: '全部',
    unit: '0'
  }
  reserveEndDate = {
    type: '1',
    value: '1',
    name: 'reserveEndDate',
    label: '年份',
    unit: '年'

  }
  reserveNumber = {
    type: '2',
    value: '2',
    name: 'reserveNumber',
    label: '个数',
    unit: '个'
  }
  _addTr() {
    if (this._data.length == 1) {
      if (this._data[0].type == '0') {
        this._data = []
        this._data.push(this.reserveEndDate)
      } else {
        this._data.push(this.reserveNumber)
      }
    }
  }
  _type = '0'
  _onSubmit(formValue) {

  }
  _selectDeleteTr(tr,index) {
    this._data.splice(index,1)
    if(this._data.length == 0){
      this._data.push(this.all)
    }
  }
  
}
